ENT.Type = "anim"
--ENT.Base = "base_hns_blocks"
ENT.PrintName = "blocktype"
ENT.Author = "Swifty"
ENT.Information = [[Safe Spot]]
ENT.Spawnable = false
ENT.AdminSpawnable = true
ENT.Category = "HNS Blocks"

if (SERVER) then

AddCSLuaFile( "shared.lua" )

	function ENT:Initialize()
		self.Entity:SetModel("models/hunter/blocks/cube1x1x025.mdl")
		self.Entity:SetSkin(0)
		self.Entity:SetSolid(SOLID_VPHYSICS)
		-- ParticleEffectAttach("env_fire_large", PATTACH_ABSORIGIN_FOLLOW, self.Entity, 0)

		local phys = self.Entity:GetPhysicsObject()
		if phys and phys:IsValid() then phys:Wake() end

	end

	function ENT:SpawnFunction( ply, tr ) 
	   
		if ( !tr.Hit ) then return end 
		 
		local SpawnPos = tr.HitPos + tr.HitNormal * 16 
		 
		local ent = ents.Create( self.Classname ) 
		ent:SetPos( SpawnPos ) 
		ent:Spawn() 
		ent:Activate() 

		return ent 
		 
	 end 
 
end

if ( CLIENT ) then

	function ENT:Initialize()
	end
	
	function ENT:Draw()
		self.Entity:DrawModel()
		offset = Vector( 0, 7, 6 )
		 cam.Start3D2D( self.Entity:GetPos() +offset, Angle(0, 0, 0), 1 )  
				 draw.DrawText(self.Entity:GetClass(), "blockfont", 1, 1, Color(0, 0, 0, 255), TEXT_ALIGN_CENTER )
				  draw.DrawText(self.Entity:GetClass(), "blockfont", 0, 0, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER )
	 cam.End3D2D()
	end

	function ENT:OnRemove()
	end

	function ENT:Think()
	end 


end
